package com.colabo.j2ee.web.oaf.security.encoder;

import org.springframework.security.authentication.encoding.MessageDigestPasswordEncoder;

/**
 * MD5加密������
 */
public class MD5PasswordEncoder extends MessageDigestPasswordEncoder implements IPasswordEncoder {
	public boolean isPasswordValid(String encPass, String rawPass, Object salt) {
		String pass1 = "" + encPass;
		String pass2 = encodePassword(rawPass, salt);
		return pass1.equals(pass2);
	}

	public MD5PasswordEncoder() {
		super("MD5");
	}

	public String encode(String pwd) {
		return encodePassword(pwd, "");
	}
}